package com.atguigu.eduservice.controller;

import com.atguigu.annotation.WebLog;
import com.atguigu.commonutils.R;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
public class EduLoginController {

    /**
     * login
     */
    @WebLog("登录")
    @PostMapping("login")
    public R login(String username, String password) {

        return R.ok().data("token", "admin");
    }

    @WebLog("获取用户信息")
    @GetMapping("info")
    public R info() {
        return R.ok().data("roles","admin").data("name","庆庆").data("avatar","http://www.weixintouxiang.cn/weixin/20140607090832328.gif");
    }

}
